MIN_HOLD block

Short summary

Name

MIN_HOLD

→POU type

→function block

Category

Standard (non-safe), SelectEnh

Conform to →IEC-standard

(plus) not defined in IEC-standard

Graphical interface

Available since

version 1.43.0 (for Neuron Power Engineer) - initial variant

version 3.8.0 (for library Standard (non-safe)): block moved in this library

Functionality

The block is a peak detector which sets the output OUT to the minimum value assigned to the input IN. Setting the input R to the value TRUE (or an equivalent) resets the output value OUT to the current input value IN.

Restrictions

The following restrictions apply to the usage of overloadable function block instances:

  • The declaration is limited to local variables.

  • The usage as array base type is not allowed.

  • The usage as structure element is not allowed.

  • Instance data cannot be displayed in the Values of Variables view.

In-/outputs

 

Identifier

→Data type

Description

Inputs:

IN

REALLREALUSINTUINTUDINTULINTSINTINTDINT or LINT
(corresponds to →generic data type ANY_NUM)

input value

R

BOOL

reset

Outputs:

OUT

REALLREALUSINTUINTUDINTULINTSINTINTDINT or LINT
(corresponds to →generic data type ANY_NUM)

minimum value

Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.

See:

Example for usage within ST-editor

FUNCTION_BLOCK ExampleMinHold
    VAR
        iMinHold : MIN_HOLD;
        inputValues : ARRAY [1..3] OF INT := [1, 10, -5];
        resultValues : ARRAY [1..3] OF INT;
        index : INT;
    END_VAR
 
    // Reset 'OUT' to '32767'.
    iMinHold(IN := 32767, R := TRUE);
 
    FOR index := 1 TO 3 DO
        iMinHold(IN := inputValues[index], R := FALSE, OUT => resultValues[index]);
    END_FOR;
 
    // 'resultValues' evaluates to '[1,1,-5]'.
    ENO := AND(resultValues[1] = 1, resultValues[2] = 1, resultValues[3] = -5);
END_FUNCTION_BLOCK

When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.